using System.ComponentModel.DataAnnotations;

namespace KnowledgeQA.Models.Entities
{
    /// <summary>
    /// 基础实体类，包含所有实体的通用属性
    /// </summary>
    public abstract class BaseEntity
    {
        /// <summary>
        /// 主键ID
        /// </summary>
        [Key]
        public int Id { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreatedAt { get; set; } = DateTime.Now;

        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime UpdatedAt { get; set; } = DateTime.Now;

        /// <summary>
        /// 是否删除（软删除）
        /// </summary>
        public bool IsDeleted { get; set; } = false;

        /// <summary>
        /// 创建人ID
        /// </summary>
        public string? CreatedBy { get; set; }

        /// <summary>
        /// 更新人ID
        /// </summary>
        public string? UpdatedBy { get; set; }
    }
} 